System and Method of Charging a Battery Using a Switching Regulator

ABSTRACT

In one embodiment the present invention includes a system and method of charging a battery using a switching regulator. In one embodiment, a switching regulator receives an input voltage and input current. The output of the switching regulator is coupled to a battery to be charged. The switching regulator provides a current into the battery that is larger than the current into the switching regulator. As the voltage on the battery increases, the current provided by the switching regulator is reduced. The present invention may be implemented using either analog or digital techniques for reducing the current into the battery as the battery voltage increases.

CROSS REFERENCE TO RELATED APPLICATIONS

This application a continuation of and claims the benefit of U.S. patentapplication Ser. No. 12/972,200, filed on Dec. 17, 2010, entitled“System and Method of Charging a Battery Using a Switching Regulator,”which is a divisional of and claims the benefit of U.S. patentapplication No. 11/356,561, filed Feb. 16, 2006, entitled “System andMethod of Charging a Battery Using a Switching Regulator,” each of whichis hereby incorporated by reference in their entirety for all purposes.

BACKGROUND

The present invention relates to switching battery chargers, and inparticular, to switching battery charging systems and methods.

Batteries have long been used as a source of power for mobile electronicdevices. Batteries provide energy in the form of electric currents andvoltages that allow circuits to operate. However, the amount of energystored in a battery is limited, and batteries loose power when theelectronic devices are in use. When a battery's energy supply becomesdepleted, the battery's voltage will start to fall from its ratedvoltage, and the electronic device relying on the battery for power willno longer operate properly. Such thresholds will be different fordifferent types of electronic devices.

Many types of batteries are designed for a single use. Such batteriesare discarded after the charge is depleted. However, some batteries aredesigned to be rechargeable. Rechargeable batteries typically requiresome form of battery charging system. Typical battery charging systemstransfer power from a power source, such as an AC wall plug, into thebattery. The recharging process typically includes processing andconditioning voltages and currents from the power source so that thevoltages and currents supplied to the battery meet the particularbattery's charging specifications. For example, if the voltages orcurrents supplied to the battery are too large, the battery can bedamaged or even explode. On the other hand, if the voltages or currentssupplied to the battery are too small, the charging process can be veryinefficient or altogether ineffective. Inefficient use of the battery'scharging specification can lead to very long charging times, forexample. Additionally, if the charging process is not carried outefficiently, the battery's cell capacity (i.e., the amount of energy thebattery can hold) may not be optimized. Moreover, inefficient chargingcan impact the battery's useful lifetime (i.e., number ofcharge/discharge cycles available from a particular battery).Furthermore, inefficient charging can result from the battery'scharacteristics changing over time. These problems are compounded by thefact that battery characteristics, including a battery's specifiedvoltages and recharge currents, can be different from battery tobattery.

Existing battery chargers are typically static systems. The charger isconfigured to receive power from a particular source and providevoltages and currents to a particular battery based on the battery'scharge specification. However, the inflexibility of existing chargersresults in many of the inefficiencies and problems described above. Itwould be advantageous to have battery charging systems and methods thatwere more flexible than existing systems or even adaptable to particularbatteries or the changing battery charging environment. Thus, there is aneed for improved battery charger systems and methods that improve theefficiency of the battery charging process. The present invention solvesthese and other problems by providing systems and methods of charging abattery using a switching regulator.

SUMMARY

In one embodiment, the present invention includes a method of charging abattery comprising receiving a first input voltage and a first inputcurrent at the input of a switching regulator, coupling an output of theswitching regulator to a terminal of a battery, generating a firstoutput voltage and a first output current at the terminal of thebattery, wherein the switching regulator controls the first outputcurrent, and wherein the first output current to the battery is greaterthan the first input current and the first input voltage is greater thanthe first output voltage, and reducing the first output current as thefirst output voltage on the battery increases.

In one embodiment, the present invention further comprises sensing thefirst output voltage on the battery, and in accordance therewith,adjusting the first output current so that the first input current isbelow a first value.

In one embodiment, the present invention further comprises sensing thefirst input current to the switching regulator, and in accordancetherewith, adjusting the first output current so that the first inputcurrent is below a first value.

In one embodiment, the present invention further comprises coupling aswitching output current and a switching output voltage of the switchingregulator through a filter to a terminal of a battery.

In one embodiment, the first output current is reduced across aplurality of current values as the first output voltage on the batteryincreases.

In one embodiment, the first output current is reduced continuously asthe first output voltage on the battery increases.

In one embodiment, the first output current is reduced incrementally asthe first output voltage on the battery increases.

In one embodiment, the first output current is reduced continuously tomaintain a constant first input current to the switching regulator.

In one embodiment, the first output current is reduced incrementally ifthe first input current to the switching regulator increases above athreshold.

In one embodiment, the present invention further comprises sensing thefirst output voltage on the battery and changing a charge parameter in aprogrammable data storage element from a first value corresponding to afirst constant output current to a second value corresponding to asecond constant output current if the sensed first output voltage isgreater than a first threshold, wherein the first constant outputcurrent is greater than the second constant output current.

In one embodiment, the present invention further comprises changing thecharge parameter across a range of values corresponding to a pluralityof successively decreasing constant output currents in response toincreases in the sensed first output voltage.

In one embodiment, the present invention further comprises sensing thefirst input current to the switching regulator and changing a chargeparameter in a programmable data storage element from a first valuecorresponding to a first constant output current to a second valuecorresponding to a second constant output current if the sensed firstinput current is greater than a first threshold, wherein the firstconstant output current is greater than the second constant outputcurrent.

In one embodiment, the present invention further comprises changing thecharge parameter across a range of values corresponding to a pluralityof successively decreasing constant output currents in response to thesensed first input current.

In one embodiment, the input of the switching regulator is coupled to aUniversal Serial Bus port.

In one embodiment, the output of the switching regulator is coupled to alithium ion battery, a nickel metal hydride battery, or a nickel cadmiumbattery.

In one embodiment, the first output current is reduced in accordancewith a predefined software algorithm.

In another embodiment, the present invention includes a method ofcharging a battery, the method comprising receiving a first inputvoltage and a first input current at the input of a switching regulator,generating a first controlled output current from the switchingregulator into the battery that is greater than the first input currentto the switching regulator, sensing a voltage on the battery or thefirst input current to the switching regulator, and reducing the firstcontrolled output current as the voltage on the battery increases.

In one embodiment, the switching regulator operates in a current controlmode.

In one embodiment, the voltage on the battery is sensed and the firstcontrolled output current is reduced continuously in response to sensingan increasing voltage on the battery.

In one embodiment, the voltage on the battery is sensed and the firstcontrolled output current is incrementally set to lower values inresponse to sensing an increasing voltage on the battery.

In one embodiment, the first input current is sensed and the firstcontrolled output current is reduced continuously to maintain a constantfirst input current to the switching regulator.

In one embodiment, the first input current is sensed and the firstcontrolled output current is reduced incrementally if the first inputcurrent to the switching regulator increases above a threshold.

In one embodiment, the method further comprises changing a chargeparameter in a programmable data storage element from a first valuecorresponding to a first constant output current to a second valuecorresponding to a second constant output current, wherein the firstconstant output current is greater than the second constant outputcurrent.

In one embodiment, the method further comprises changing a chargeparameter in a programmable data storage element across a range ofvalues corresponding to successively decreasing constant output currentsin response to an increasing voltage on the battery.

In one embodiment, the method further comprises changing a chargeparameter in a programmable data storage element from a first valuecorresponding to a first constant output current to a second valuecorresponding to a second constant output current that is less than thefirst output current if the first input current increases above athreshold.

In another embodiment, the present invention includes a battery chargercomprising a switching regulator having a first input, a first output,and a control input, wherein the first input receives a first inputvoltage and a first input current, and the first output is coupled to abattery to provide a first output voltage and a first output current, anadjustable current controller having at least one input coupled to sensethe first output current, at least one output coupled to a control inputof the switching regulator, and a second input coupled to the firstinput of the switching regulator for detecting changes in the inputcurrent or to the battery for detecting changes in the first outputvoltage, wherein the second input changes the first output current tothe battery in response to changes in the first input current or firstoutput voltage, wherein the switching regulator provides a first outputcurrent to the battery that is greater than the first input current, andwherein the first output current is reduced as the voltage on thebattery increases.

In one embodiment, the battery charger further comprises a senseresistor coupled between the first output of the switching regulator andthe battery for sensing the first output current, wherein the at leastone input of the adjustable current controller comprises a first inputcoupled to a first terminal of the sense resistor and a second inputcoupled to a second terminal of the sense resistor.

In one embodiment, the switching regulator operates in a current controlmode.

In one embodiment, the first output current is adjusted so that thefirst input current remains below a first value.

In one embodiment, the battery charger further comprises a sense circuitthat senses the first input current and the second input of theadjustable current controller is coupled to the sense circuit fordetecting changes in the input current.

In one embodiment, the sense circuit comprises a first resistor coupledto the input of the switching regulator.

In one embodiment, the battery charger further comprises an analog ordigital controller coupled between the sense circuit and the adjustablecurrent controller, wherein the analog or digital controller changes acontrol voltage at the second input of the adjustable current controllerif the first input current increases above a first threshold.

In one embodiment, the controller is a digital controller, and thedigital controller changes digital bits in at least one programmablestorage element if the first input current increases above a firstthreshold.

In one embodiment, the controller is an analog controller, and theanalog controller has at least one input coupled to the sense circuitand at least one output coupled to the adjustable current controller,and where the analog controller changes a voltage at the second input ofthe adjustable current controller if the first input current increasesabove a first threshold.

In one embodiment, a second input of the adjustable current controlleris coupled to the battery for detecting changes in the first outputvoltage.

In one embodiment, the battery charger further comprises a digitalcontroller having at least one input coupled to the battery and anoutput coupled to the second input of the adjustable current controller,wherein the digital controller changes digital bits in at least oneprogrammable data storage element if the first output voltage increasesabove a first threshold, and in accordance therewith, changes a voltageat the second input of the adjustable current controller for reducingthe first output current.

In one embodiment, the battery charger further comprises ananalog-to-digital converter coupled between the battery and the at leastone input of the digital controller, and a digital-to-analog convertercoupled between the programmable data storage element and the secondinput of the adjustable current controller.

In one embodiment, the programmable data storage element is a register.

In one embodiment, the programmable data storage element is a registerand the digital controller changes digital bits in the register byloading digital bits into the register from a volatile memory.

In one embodiment, the programmable data storage element is a registerand the digital controller changes digital bits in the register byloading digital bits into the register from a nonvolatile memory.

In one embodiment, the switching regulator further comprises a switchingtransistor, an error amplifier, and switching circuit, and at least oneoutput of the adjustable current controller is coupled to a controlterminal of the switching transistor through the error amplifier andswitching circuit.

In one embodiment, the switching regulator comprises a pulse widthmodulation circuit.

In one embodiment, the adjustable current controller generates a firstcontrol signal to the switching regulator to produce a constant firstoutput current into the battery, and the adjustable current controllerchanges the first control signal to continuously reduce the constantfirst output current as the voltage on the battery increases.

In one embodiment, the adjustable current controller generates a firstcontrol signal to the switching regulator to produce a constant firstoutput current into the battery, and at least one data storage elementcoupled to the adjustable current controller is reprogrammed by acontroller in response to an increase in the first input current orfirst output voltage, and in accordance therewith, the adjustablecurrent controller changes the first control signal to incrementallyreduce the constant first output current.

In one embodiment, the battery charger further comprises a registercoupled to the second input of the adjustable current controller,wherein digital bits in the register are changed, in response to anincrease in the first input current or first output voltage, from afirst value to a second value, and in accordance therewith, the firstoutput current is reduced.

In another embodiment, the present invention includes a method ofcharging a battery, the method comprising receiving a first voltage anda first current at a first terminal of a switching transistor, whereinthe first voltage and first current are coupled to the first terminal ofthe switching transistor from a power source, receiving a switchingsignal at a control input of the switching transistor, and in accordancetherewith, generating a second voltage and a second current at a secondterminal of the switching transistor, filtering the second voltage andsecond current to produce a filtered voltage and filtered current,coupling the filtered voltage and filtered current to a terminal of abattery, wherein the filtered voltage at the terminal of the battery isless than the first voltage at the first terminal of the switchingtransistor, and wherein the filtered current into the terminal of thebattery is greater than the first current into the first terminal of theswitching transistor, and reducing the filtered current across a rangeof current values that are greater than a value of the first current asthe voltage on the battery increases across a corresponding range ofvalues that are less than the first voltage.

In one embodiment, filtering comprises coupling the second current tothe battery terminal through at least one inductor.

In one embodiment, the filtered current is adjusted so that the firstcurrent remains below a first value.

In one embodiment, the method further comprises sensing the filteredcurrent and the voltage on the battery, and in accordance therewith,controlling the filtered current.

In one embodiment, the method further comprises sensing the firstcurrent and the filtered current, and in accordance therewith,controlling the filtered current.

In one embodiment, the power source is a Universal Serial Bus port.

In another embodiment, the present invention includes a battery chargercomprising a switching regulator including at least one switchingtransistor, the switching transistor having a first input to receive afirst input voltage and a first input current, and a first outputcoupled to a battery to provide a first output voltage and a firstoutput current, a current controller for controlling the first outputcurrent to the battery, the current controller having at least one inputfor sensing the first output current to the battery, a second input foradjusting the first output current in response to a control signal, anda first output coupled to the switching regulator, and a controllerhaving a first input coupled to the first input of the switchingregulator or the battery, and at least one output coupled to the secondinput of the current controller, wherein the controller is responsive toincreases in the first input current or first output voltage, andwherein the controller changes the control signal at the second input ofthe current controller to reduce the first output current if the firstinput current or first output voltage increase, wherein the switchingregulator provides a first output current to the battery that is greaterthan the first input current, and wherein the first output current isreduced as the first output voltage on the battery increases.

In one embodiment, the battery charger further comprises an output senseresistor coupled to the first output of the switching transistor forsensing the first output current, and the current controller is coupledto first and second terminals of the output sense resistor forcontrolling the first output current.

In one embodiment, the battery charger further comprises an input senseresistor coupled to the first input of the switching transistor forsensing the first input current and the controller is coupled to firstand second terminals of the input sense resistor.

In one embodiment, the controller comprises an analog controller and theanalog controller generates a control voltage at the second input of thecurrent controller for reducing the first output current in response tothe first input current.

In one embodiment, the controller comprises a digital controller, thecircuit further comprising an analog-to-digital converter having inputscoupled across the input sense resistor and an output coupled to thedigital controller, a register coupled to the digital controller, and adigital-to-analog converter having an input coupled to the register andan output coupled to the second input of the current controller, whereinthe digital controller reprograms the register in response to anincrease in the first input current, and in accordance therewith, thefirst output current is reduced.

In one embodiment, the battery charger further comprises a nonvolatilememory and the digital controller reprograms the register withparameters stored in the nonvolatile memory.

In one embodiment, the battery charger further comprises a volatilememory and the digital controller reprograms the register withparameters stored in the volatile memory.

In one embodiment, the first input of the controller is coupled to thebattery.

In one embodiment, the controller comprises an analog controller,wherein the analog controller generates a control voltage at the secondinput of the current controller for reducing the first output current inresponse to the first output voltage.

In one embodiment, the controller comprises a digital controller, thecircuit further comprising an analog-to-digital converter having aninput coupled to the battery and an output coupled to the digitalcontroller, a register coupled to the digital controller, and adigital-to-analog converter having an input coupled to the register andan output coupled to the second input of the current controller, whereinthe digital controller reprograms the register in response to anincrease in the first output voltage, and in accordance therewith, thefirst output current is reduced.

In one embodiment, the battery charger further comprises a nonvolatilememory and the digital controller reprograms the register withparameters stored in the nonvolatile memory.

In one embodiment, the battery charger further comprises a volatilememory and the digital controller reprograms the register withparameters stored in the volatile memory.

In one embodiment, the controller and current controller are on the sameintegrated circuit.

In one embodiment, the controller and current controller are ondifferent integrated circuits.

In another embodiment, the present invention includes a battery chargercomprising a switching regulator including at least one switchingtransistor, the switching transistor having a first input to receive afirst input voltage and a first input current, and a first outputcoupled to a battery to provide a first output voltage and a firstoutput current, current controller means, coupled to the switchingregulator, for sensing and controlling the output current to the batteryand for changing the first output current to the battery in response toa control signal, and controller means for generating the control signalto the current controller means in response to the first input currentor first output voltage, wherein the switching regulator provides afirst output current to the battery that is greater than the first inputcurrent, and wherein the first output current is adjusted as the voltageon the battery increases.

In one embodiment, the battery charger further comprises sense circuitmeans for sensing the first input current.

In one embodiment, the battery charger further comprises sense circuitmeans for sensing the first output current.

In one embodiment, the controller means comprises an analog circuit.

In one embodiment, the controller means comprises a digital circuit.

In one embodiment, the current controller means comprises first andsecond inputs for receiving voltages corresponding to the first outputcurrent, and a second input for receiving the control signal to reducethe first output current as the voltage on the battery increases.

In one embodiment, the battery charger further comprises voltage controlmeans for controlling the first output voltage.

In one embodiment, the switching regulator further comprises switchingcircuit means for providing a switching signal to a control terminal ofthe switching transistor.

The following detailed description and accompanying drawings provide abetter understanding of the nature and advantages of the presentinvention.

BRIEF DESCRIPTION OF THE DRAWINGS

FIG. 1 illustrates an electronic device including a switching batterycharger according to one embodiment of the present invention.

FIG. 2 illustrates a switching battery charger including a switchingregulator according to one embodiment of the present invention.

FIG. 3 illustrates charging a battery using a switching regulatoraccording to one embodiment of the present invention.

FIGS. 4A-B illustrate charging a battery using a switching regulatoraccording to embodiments of the present invention.

FIG. 5 illustrates an example implementation of a battery chargingsystem according to one embodiment of the present invention.

FIG. 6 illustrates an example implementation of a battery chargingsystem according to one embodiment of the present invention.

FIG. 7 is an example of a battery charger according to one embodiment ofthe present invention.

FIG. 8 is an example of a voltage controller according to one embodimentof the present invention.

FIG. 9 is an example of a current controller according to one embodimentof the present invention.

FIG. 10 is an example of an analog controller according to oneembodiment of the present invention.

DETAILED DESCRIPTION

Described herein are techniques for switching battery charging systemsand methods. In the following description, for purposes of explanation,numerous examples and specific details are set forth in order to providea thorough understanding of the present invention. It will be evident,however, to one skilled in the art that the present invention as definedby the claims may include some or all of the features in these examplesalone or in combination with other features described below, and mayfurther include obvious modifications and equivalents of the featuresand concepts described herein.

FIG. 1 illustrates a system 100 including electronic device 101including a switching battery charger according to one embodiment of thepresent invention. An electronic device 101 includes device electronics102 powered by a battery 150. The battery may be recharged usingswitching battery charger 103. Switching battery charger 103 has a firstinput coupled to a first power source 110 (e.g., an input voltage Vinfrom a power supply line of a Universal Serial Bus, “USB,” port) and afirst output to provide a regulated output to at least one batterythrough a filter as described in more detail below. The output voltagesand currents provided to the filter will be switched waveforms. For thepurposes of this description, the output of the switching regulator willbe the output of the filter, which includes a filtered output current tothe battery (i.e., a battery charge current) and a filtered outputvoltage at the battery terminal. Charger 103 may further includeinternal circuitry for sensing input currents, battery currents, and/orvoltages, for example. Charger 103 may use such information forcontrolling the transfer of voltage and current from the power source110 to the terminal of battery 150.

In one embodiment, switching battery charger 103 is operated in acurrent control mode to provide a controlled current to battery 150during a first time period in a charging cycle. During a second timeperiod in the charging cycle, charger 103 operates in a voltage controlmode to provide a controlled voltage to battery 150. In a currentcontrol mode, the output current of the switching charger (i.e., thecurrent into the battery) is used as the control parameter for thecircuit (e.g., the current into the battery may be used to control afeedback loop that controls switching). Similarly, in a voltage controlmode, the output voltage of the switching charger (i.e., the voltage onthe battery) is used as the control parameter for the circuit (e.g., thevoltage on the battery may be used to control a feedback loop thatcontrols switching). For example, when the charger is in current controlmode (e.g., when the battery voltage is below a certain threshold), theswitching regulator may control the output current sourced into thebattery. The system may then switch from current control mode to voltagecontrol mode if a voltage on the battery increases above a specifiedthreshold value. If the voltage on the battery rises to a particularlevel, the system may then control the voltage on the battery (e.g., bymaintaining a constant battery voltage) as the uncontrolled currenttapers off. In one embodiment, the current sourced to battery 150 byswitching regulator 103 may be modified as the battery charges (e.g., asthe battery voltage increases). In one specific example, the sourcedcurrent is changed by a digital controller that changes stored chargingparameters stored in programmable data storage elements (e.g., aregister or memory). In another specific example, the sourced current ischanged by an analog controller that changes control signals at acontrol input of a current controller that controls the output current.

Embodiments of the invention may be used in a variety of electronicdevices and for charging a variety of battery types and configurations.To illustrate the advantages of certain aspects of the presentinvention, an example will be described in the context of charging alithium ion (“Li+”) battery. However, it is to be understood that thefollowing example is for illustrative purposes only, and that othertypes of batteries, such as lithium polymer batteries, nickel metalhydride batteries, or nickel cadmium batteries, for example, havingdifferent voltages and charge specifications could also beadvantageously charged using the techniques described herein.

FIG. 2 illustrates a switching battery charger 201 including a switchingregulator 203 according to one embodiment of the present invention.Device electronics 202 includes a power supply terminal (“Vcc”) thatreceives power from battery 250. When the battery 250 is depleted, itmay be recharged by coupling voltage and current from a power source 210to the battery 250 through a switching regulator 203 and filter 204. Forexample, the power source may be a DC power source. It is to beunderstood that the techniques described herein may also be applied toAC power sources. Thus, FIG. 2 is one example system using DC power.Switching regulator 203 may include a switching device 221, a switchingcircuit (“switcher”) 222, an adjustable current controller 223, anoutput sense circuit 225, and an input sense circuit 224. Switchingregulator 203 is distinguished from a linear regulator in that switchingregulator 203 includes a switching circuit 222 that generates aswitching control signal 222A at the control terminals of transistor221. For example, the switching device 221 may be a PMOS transistor.However, it is to be understood that the switching device may beimplemented using other types of devices such as one or more bipolar orMOS transistors, for example.

In current control mode, output sense circuit 225 senses the outputcurrent into the battery. Current controller 223 is coupled to outputsense circuit 225 for controlling the output current. Current controller223 receives inputs from output sense circuit corresponding to theoutput current. Current controller 223 uses these inputs to controlswitching circuit 222, which in turn provides signals to the controlterminal of switching device 221 that modify the output current. Anexample switching control scheme may include pulse width modulating thecontrol terminal of switching device 221. The output of switchingregulator 203 is coupled through a filter 204 to a terminal of battery250. Voltages or currents at the battery terminal may be controlled bysensing the battery voltage or current into the battery. In currentcontrol mode, current controller 223 may receive the sensed batterycurrent and modify control signal 222A to change the behavior ofswitching circuit 222 and switching device 221 to maintain the batterycurrent at a controlled value. Similarly, in voltage control mode, avoltage controller (described below) may receive the sensed batteryvoltage, and modify control signal 222A to change the behavior ofswitching circuit 222 and switching device 221 to maintain the batteryvoltage at a controlled value. Accordingly, the voltages or currentsinto the battery can be maintained at controlled values. As described inmore detail below, current controller 223 may include another inputcoupled to either the voltage on the battery or the input current to theswitching regulator to control modification of the battery current asthe voltage on the battery increases. Since either battery voltage orinput current may be used for this purpose, the system may or may notinclude an input sense circuit 224.

In one embodiment, switching regulator 203 receives a voltage andcurrent from power source 210 and provides a charge current to thebattery that is greater than the current received from the power source.For example, if the voltage received from the power source is greaterthan the battery voltage, then the switching regulator can provide acharge current into the battery that is greater than the input currentto the switching regulator. When the voltage at the input of theswitching regulator is greater than the voltage on the battery(sometimes referred to as a “Buck” configuration), the “ideal”voltage-current relationship of the switching regulator is given asfollows:

Vout=C*Vin; and

Iout=Iin/C,

-   where C is a constant. For example, in a pulse width modulated    switching regulator, C is the “Duty Cycle,” D, of the switching    waveform at the control input of the switching device(s). The above    equations illustrate that the output current is a function of the    input current, input voltage, and output voltage as follows:

Iout=Iin*(Vin/Vout).

-   It is to be understood that the above equations apply to an “ideal”    buck regulator. In an actual implementation, the output is derated    for non-idealities (i.e., efficiency losses), which may be around    10% (i.e., efficiency, η=90%). The above equations illustrate that    the charge current into battery 250 may be larger than the input    current (i.e., where the input voltage Vin is greater than the    output voltage). Moreover, at the beginning of a charge cycle, the    battery voltage is less than at a point in time later in the charge    cycle. Thus, at the beginning of the charge cycle the current into    the battery may be larger (i.e., when Vin/Vbatt is larger; where    Vbatt=Vout) than the current into the battery at later points of    time in the charge cycle (i.e., when Vin/Vbatt is smaller). In one    embodiment, the current into the battery (i.e., the output current    of the switching regulator) is controlled and set to an initial    value, and as the battery voltage increases, the output current is    reduced. The above equations illustrate that as the battery voltage    increases, the current into the switching regulator will start to    increase for a given current at the output of the switching    regulator. This effect results from the voltage-current    relationships on the switching regulator shown above. For example,    if Iout and Vin are fixed, then Iin must increase as Vout increases.    Accordingly, different embodiments may sense the output voltage or    input current, and reduce the current into the battery as the    battery voltage increases.

For example, switching regulator 203 may operate in a current controlmode, wherein the output sense circuit 225 senses the output current ofthe switching regulator (i.e., the battery input current), and currentcontroller 223 controls the reduction of current into the battery as thevoltage on the battery increases. In one embodiment, current controller223 may reduce the battery current in response control signalscorresponding to an increasing battery voltage, which signal currentcontroller 223 to reduce the battery current. In another embodiment,input sense circuit 224 senses the input current to the switchingregulator, and current controller 223 reduces the current into thebattery in response to control signals corresponding to an increasinginput current. Equivalently, other parameters related to the inputcurrent or battery voltage could be monitored to obtain the desiredinformation for adjusting the current into the battery. In oneembodiment, a controller (described in more detail below) is used forgenerating one or more control signals to the current controller inresponse to the first input current or first output voltage. Acontroller is a circuit that receives the sensed parameter (e.g., inputcurrent or battery voltage as an analog or digital signal) and generatesone or more control signals to current controller 223 to adjust thecurrent at the output. Sense circuits, controllers and currentcontrollers may be implemented as analog circuits (in whole or in part)so that the switching regulator output current (i.e., the batterycharging current) is reduced continuously as the switching regulatoroutput voltage on the battery increases. In another embodiment, thecontrollers and/or current controllers may be implemented as digitalcircuit (in whole or in part) so that the battery charging current isreduced incrementally as the battery voltage increases. Examples ofthese circuits are described below.

FIG. 3 illustrates charging a battery using a switching regulatoraccording to one embodiment of the present invention. At 301, an inputvoltage and an input current are received at the input of a switchingregulator. At 302, a switching output current and voltage at the outputof the switching regulator are coupled to the terminal of a battery. Forexample, an output terminal of a switching transistor may be coupledthrough a filter to the battery terminal. At 303, an output voltage(i.e., the battery voltage) and output current (i.e., battery inputcurrent) are generated at the output of the switching regulator. At 304,the current into the battery is reduced as the output voltage on thebattery increases. As mentioned above, the switching regulator maydetect the rise in the battery voltage by sensing either the batteryvoltage directly, the input current, or other related parameters.

FIGS. 4A-B illustrate charging a battery using a switching regulatoraccording to embodiments of the present invention. The graph in FIG. 4Ashows the current plotted on the right vertical axis and the voltage onthe battery on the left vertical axis versus time on the horizontalaxis. Voltage on the battery over time is shown by the line 401, currentinto the battery is shown by the line 402, and current into theswitching regulator is shown by the line 403. This example illustrates acharge cycle for charging a deeply depleted Li+ battery. The battery ischarged in two basic modes: a current control mode (t=0, t2) and avoltage control mode (t=t2, t3). In this example, the voltage on thebattery is initially below some particular threshold (e.g., 3 volts),indicating that the battery is deeply depleted. Accordingly, the currentcontrol mode may initially generate a constant precharge current 410(e.g., 100 mA). The constant precharge current 410 will cause thebattery voltage to start to increase. When the battery voltage increasesabove a precharge threshold 420 (e.g., 3 volts), the system willincrease the current sourced to the battery. The second current issometimes referred to as the “fast charge” current.

As shown in FIG. 4A, the current into the battery may be larger than thecurrent received by the switching regulator. For example, at thebeginning of the fast charge cycle, the current into the battery may beinitially set at 750 mA, whereas the current into the switchingregulator is 500 mA. Accordingly, the voltage on the battery will beginto increase as the battery is charged. As the battery voltage increases,the current into the battery may be reduced so that the input currentremains approximately constant. As mentioned above, if the voltage onthe battery increases, and if the current supplied by the switchingregulator remains constant, the current into the switching regulatorwill begin to increase. In some applications it may be desirable tomaintain the input current below some threshold values so that the totalpower into the switching regulator does not exceed the total poweravailable at the power source. In this example, the input current ismaintained approximately constant and the current into the battery isreduced as the battery voltage increases. For instance, when the batteryvoltage increases above 3 volts at 420B, the current into the battery isreduced to about 700 mA. From FIG. 4A it can be seen that the current issuccessively decreased as the voltage on the battery increases tomaintain the input current approximately constant. As mentioned above,either analog or digital techniques may be used to control the batterycurrent. Additionally, the system may sense either the input current tothe switching regulator or battery voltage to implement battery currentcontrol.

When the voltage on the battery increases above a threshold 430A at timet2, the system may automatically transition to provide a constantvoltage to the battery (i.e., the “float” voltage). When the batteryincreases to the float voltage during current control mode, the systemwill transition into voltage control mode and maintain the float voltageat the battery. While the system is in voltage control mode, the current430 into the battery will begin to decrease (i.e., “taper” or “falloff”). In some embodiments, it may be desirable to turn off the chargerafter the current reaches some minimum threshold 440. Thus, when thebattery current falls below a minimum value, the system mayautomatically shut down the charger and end the charge cycle at time t3.

FIG. 4B illustrates the input current to a switching regulator and thebattery current provided by the switching regulator versus batteryvoltage. The graph in FIG. 4B shows the current plotted on the leftvertical axis and battery voltage on the horizontal axis. Initially, thebattery voltage is below some threshold (e.g., 3 volts), the system isin precharge mode, and the switching regulator is set to provide aconstant precharge current 410A (e.g., 100 mA) to the battery.Accordingly, the input current 410B is less than battery current (e.g.,<100 mA). When the system transitions into fast charge mode (e.g., as aresult of the battery voltage increases above some threshold value, suchas 3 volts), the battery current may be reset from a precharge value toa maximum value 402A (e.g., 700 mA). When the current supplied to thebattery from the switching regulator is increased, the input current issimilarly increased to a new value 403A (e.g., about 475 mA). However,as the battery voltage increases above the threshold, the input currentwill increase if the output current is held constant. In someapplications, the power source, such as a USB power source, may not beable to supply input current to the switching regulator above somemaximum value (e.g., 500 mA for USB). The maximum input value may betaken into consideration when setting the current into the battery.Accordingly, when the input current increases to some threshold value(e.g., a maximum allowable level such as 500 mA), the system may resetthe battery current to a new value 402B less than the previous value sothat the input current is accordingly reduced below the threshold at403B (e.g., about 450 mA). The output current into the battery may bereduced incrementally as the output voltage on the battery increases sothat the input current remains below a threshold as shown in FIG. 4B. Inone embodiment, the output current is reduced incrementally in responseto sensing the input current to the switching regulator, and determiningthat the input current has increased above a threshold. In anotherembodiment, the output current is reduced incrementally in response tosensing the battery voltage.

FIG. 5 illustrates an example implementation of a battery chargingsystem 500 according to one embodiment of the present invention. Thisexample illustrates one possible implementation using a digitalcontroller 545 and programmable storage for adjusting the batterycurrent as the battery voltage increases. Battery charger 500 includes aswitching regulator 510 having an input for receiving input voltage andcurrent from a power source. The output of switching regulator 510 iscoupled to battery 550 through a filter comprising an inductor 503 andcapacitor 504. A current sense resistor 501 may also be included in thecurrent path to the battery. A current controller 520 has a first inputcoupled to a first terminal of current sense resistor 501 and a secondinput coupled to a second terminal of current sense resistor 501 forsensing the battery current. In current control mode, current controller520 receives the sensed battery current and provides a control signal toa control input of switching regulator 510. In this example, currentcontroller 520 is an adjustable current controller, and includes acontrol input 520A that receives control signals for adjusting theoutput current generated by the switching regulator. System 500 furtherincludes a voltage controller 530 for the voltage control mode of acharge cycle. Voltage controller 530 includes a first input coupled tothe terminal of the battery for sensing battery voltage. In voltagecontrol mode, the output of voltage controller 530 generates a controlsignal to switching regulator 510. In this example, voltage controller530 is an adjustable voltage controller, and includes a control input530A for adjusting the output current generated by the switchingregulator.

Charging system 500 further includes data storage coupled to currentcontroller 520 and voltage controller 530 for configuring the switchingregulator in current control and voltage control modes. Programmabledata storage elements, such as registers or memory, may store aplurality of charging parameters for controlling switching regulator 510during the charging of battery 550. The parameters may be reprogrammedto change the voltages and/or currents or other parameters used tocharge the battery, and thereby improve battery charging efficiency.Data storage may be either volatile or nonvolatile memory, for example,and the charging parameters may be reprogrammed across different chargecycles or during a single charge cycle (while the battery is charging).

In this example, a digital controller 545 is used to modify the controlinput of current controller 520 to change the battery current as thevoltage on the battery increases. In one embodiment, a sense circuit(e.g., an input sense resistor 502) may be used to sense the switchingregulator's input current. In this example, the input sense resistor 502is the means for sensing the first input current received by theswitching regulator. Equivalent sensing means may include transistor orinductive sense techniques, for example. The terminals of resistor 502are coupled to digital controller 545 through an analog-to-digital(“A/D”) converter 548. In another embodiment, the voltage on the batterymay be coupled to digital controller 545 through A/D 549. Controller 545receives the sensed input current or output voltage and adjusts currentcontroller 520 to control the battery current as described above. Forexample, digital controller 545 may be used to program data storageelements with charging parameters, which, in turn, are converted toanalog signals and coupled to the control input 520A of currentcontroller 520. The charging parameters in data storage may beprogrammed through controller 545 using a digital bus 541 (e.g., aserial or parallel bus), for example. Accordingly, the chargingparameters may be changed under control of a predefined softwarealgorithm. Controller 545 may be included on the same integrated circuitas the switching regulator and switching battery charger circuitry, orcontroller 545 may be included on another integrated circuit in theelectronic device. In one embodiment, the digital bus may be coupled toor implemented using an I²C bus or Universal Serial Bus (“USB”), forexample.

In one embodiment, charging parameters may each be stored as a pluralitydigital bits, and different charging parameter may be programmed inregister 522 from volatile memory 546 or nonvolatile memory 547, whichmay be local or remote (e.g., on the same integrated circuit or systemor on another integrated circuit or system). The digital bitscorresponding to a plurality of charging parameters may then beconverted to an analog parameter, such as a voltage or current. Theanalog parameter may, in turn, be coupled to the control input ofcurrent controller 520, and in turn to the control input of switchingregulator 510 to change the battery current. In one embodiment, thedigital bits may be converted to an analog parameter using adigital-to-analog converter (“DAC”) 524, for example. A variety oftechniques may be used for A/Ds and DACs. In this example, the DAC 524,register 522, digital controller 545, and either A/D 548 or A/D 549comprise the means for generating the control signal to the currentcontroller in response to the first input current or first outputvoltage. It is to be understood that other sense and control circuittechniques may be used, and that the resistor sensing, A/Ds, registers,and DACs are just an example.

In one embodiment, a charge cycle includes precharging and fast chargingcurrent control modes, and a voltage control mode. For example, currentto the battery may be programmed by parameters stored as digital valuesin registers 521 and 522. Register 521 may store a digital prechargeparameter value, and register 522 may store one or more digital fastcharge parameter values. Different fast charge parameter values may beselectively coupled to the current controller 520 to set the currentsupplied to the battery based on either a sensed battery voltage or asensed battery current. In this example, register 525 may hold a digitalvalue for setting the precharge threshold. The bits of register 525 maybe inputs to a digital-to-analog converter (“DAC”) 526, which maytranslate the bits into an analog parameter such as a voltage, forexample. A voltage output of DAC 526 may be used as a reference andcompared to the battery voltage in comparator 527. When the batteryvoltage is below the programmed precharge threshold, the comparator maycouple the stored precharge current value in register 521 to DAC 524using select circuit 523 (e.g., a multiplexer). DAC 524, in turn,receives the digital value corresponding to the precharge current andgenerates an analog parameter for controlling the regulator to deliverthe programmed current value. When the battery voltage increases abovethe value programmed in register 525, the comparator changes state, andselect circuit 523 couples the stored fast charge current value inregister 522 to DAC 524. DAC 524, in turn, receives the new digitalvalue corresponding to the fast charge current and generates an analogparameter for controlling the switching regulator to deliver the newprogrammed current value. It is to be understood that the above circuitis just one example implementation. In another example, the prechargethreshold may be controlled by using the battery voltage to drive avoltage divider. Particular taps of the voltage divider may be digitallyselected by a programmable register. A selected tap may then be coupledto a comparator and compared to a reference voltage, for example.

As the battery voltage increases, digital controller 545 may reprogramregister 522 to change the battery current. For example, digitalcontroller 545 may compare the battery voltage against a threshold(either in software or in hardware), and reprogram register 522 if thebattery voltage is above the threshold. As the battery voltageincreases, controller 545 may compare the battery voltage againstdifferent thresholds to change the output current. The thresholds may belinearly spaced apart, for example, or determined according toparticular system requirements. Alternatively, digital controller 545may compare the regulator input current against a threshold (either insoftware or in hardware), and reprogram register 522 if the inputcurrent is above the threshold.

For voltage control mode, voltage controller 530 is coupled to register531 for storing the threshold for changing from current control tovoltage control. Register 531 stores the threshold as a digital value.The digital bits of register 531 are input to DAC 532 and converted intoan analog parameter for maintaining a constant programmed voltage on thebattery. When the battery voltage increases above the voltage programmedin register 531, the system will transition into voltage control mode,and a constant programmed voltage will be maintained at the output ofthe regulator and the current gradually decreases.

Digital controller 545 may also be used to manipulate other digitalinformation in the system. Controller may include circuits for readingand writing to memory or registers, for example, as well as other systemcontrol functions such as interfacing with other electronics over aserial or parallel bus. As mentioned above, the charging parameters maybe stored in a nonvolatile memory 547 such as an EEPROM, for example, ora volatile memory 546. The nonvolatile or volatile memories may be onthe same integrated circuit as the switching regulator or the memoriesmay be external. If the memories are external, the system may furtherinclude an interface (not shown) for accessing external resources. Inthis example, the parameters are stored in nonvolatile memory 546 andtransferred to registers 521, 522, 525, and 531.

Embodiments of the present invention further include reprogramming oneor more charging parameters in accordance with a predefined softwarealgorithm. Software for controlling the charging process may be writtenin advance and loaded on the electronic device to dynamically controlthe charging process. For example, an electronic device may include aprocessor, which may be a microprocessor or microcontroller, forexample. The processor may access charge control software in volatile ornonvolatile memory and may execute algorithms for reprogramming thecharging parameters. The algorithm may change one or more chargingparameters while the battery is charging, for example, or the algorithmmay change one or more charging parameters over multiple chargingcycles. The algorithm may change the parameter values in either theregisters (e.g., for dynamic programming) or in the nonvolatile memory(e.g., for static programming) For example, the algorithm may bereceived as inputs sensed battery conditions, and the algorithm maymodify the programmed fast charge current based on such conditions. Fromthe example shown in FIG. 5, it can be seen that including digitalcontrol in the system allow flexible programmability of a variety ofparameters, including the current delivered to the battery duringrecharging or the thresholds compared against the battery voltage orinput current to control changes in the output current. Such thresholdsmay be modified across multiple charge cycles or even during a singlecharge cycle.

FIG. 6 illustrates an example implementation of a battery chargingsystem 600 according to one embodiment of the present invention. Thisexample illustrates one possible implementation using analog controller645 for adjusting the battery current as the battery voltage increases.Battery charger 600 includes a switching regulator 610 having an inputfor receiving voltage and current from a power source. The output ofswitching regulator 610 is coupled to battery 650 through a filtercomprising an inductor 603 and capacitor 604. As described for batterycharging system 500 in FIG. 5, in current control mode, currentcontroller 620 senses the output current and provides a control signalto a control input of switching regulator 610 for controlling thecurrent sourced to the battery. In this example, a current senseresistor 601 is included in the current path to the battery, and currentcontroller 620 has a first input coupled to a first terminal of currentsense resistor 601 and a second input coupled to a second terminal ofcurrent sense resistor 601 for sensing the battery current. As incharger 500 in FIG. 5, current controller 620 is an adjustable currentcontroller, and includes a control input 646 that receives controlsignals for adjusting the output current generated by the switchingregulator. System 600 further includes a voltage controller 630 for thevoltage control mode of a charge cycle. Voltage controller 630 includesa first input coupled to the terminal of the battery for sensing batteryvoltage. In voltage control mode, the output of voltage controller 630generates a control signal to switching regulator 610.

In this example, analog controller 645 provides the means for generatingthe control signal to the current controller in response to the firstinput current or first output voltage. Analog controller 645 may becoupled to either the battery terminal for sensing the battery voltageor to an input current sense circuit for sensing input current to theswitching regulator. In this example, the input current sense circuit isa current sense resistor 602 coupled to the input of switching regulator610. In this example, analog controller 645 may have an input coupled tothe battery, or analog controller 645 may include two inputs coupledacross sense resistor 601. In response to either the sense input currentor battery voltage, analog controller modifies one or more controlsignals on the control input 646 of current controller 620 to change thebattery current. Analog controller 645 may use a variety of differentinput or output circuit techniques to sense the input current or batteryvoltage and generate the proper signal or signals depending on theparticular implementation of current controller 620. For example, analogcontroller 645 may include amplifiers, current sources, limiters, and/orcomparison circuits, for example, for processing the sensed voltages orcurrents and generating one or more control signals on control input 646to current controller 620 to adjust the battery current. It is to beunderstood that a variety of sensing circuits and analog circuits may beused. Thus, the battery current generated in current control mode may beadjusted by analog controller 645 in response to either the sensedbattery voltage input or the sensed input current. Accordingly, currentcontroller 620 may generate a current into the battery that is greaterthan the current into the switching regulator as described above.Current controller 620 may sense the input current to the battery andthe control signal from analog controller 645, and the battery currentmay be reduced as the voltage on the battery increases.

FIG. 7 is an example of a battery charger according to one embodiment ofthe present invention. Battery charger 700 includes a voltage controller701, a current controller 702, and a switching regulator 703 coupled toa transistor 707 (e.g., a PMOS transistor) for controlling the voltageand current coupled between an input terminal 708 and an output terminal709. Current controller 702 includes a first input terminal 710 and asecond input terminal 711 for sensing the current through an outputcurrent sense resistor (e.g., 0.1 Ohm Resistor). Terminal 710 is coupledto the positive terminal of the resistor, which is coupled to terminal709 of transistor 707, and terminal 711 is coupled to the negativeterminal of the resistor, which is coupled to a battery (in a switchingregulator, terminal 709 is coupled to an inductor, and the otherterminal of the inductor may be coupled to terminal 710). Currentcontroller 702 further includes a control input 750 for controlling theamount of current generated by the switching regulator in response tothe current sensed between terminals 710 and 711. The output of currentcontroller 702 is coupled to the input of regulator 703. Voltagecontroller 701 includes a battery sense input terminal 712, which iscoupled to the battery, and a control input 751, which may be coupled toa DAC, for example. The output of voltage controller 701 is also coupledto the input of switching regulator 703. Switching regulator 703 mayinclude an error amplifier 704 having a first input coupled to areference voltage 714 (e.g., 1 volt) and a second input terminal coupledto the output of the voltage controller 701 and current controller 702.The output of error amplifier 704 is coupled to the input of a switchingcircuit 705, such as a duty cycle control input of a pulse widthmodulation (“PWM”) circuit, for example. It is to be understood that avariety of switching techniques could be used to practice the presentinvention. Node 713 is a negative feedback node of the regulator. Thus,under either current control or voltage control, the loop will drivenode 713 to the same voltage as the reference voltage of the erroramplifier (e.g., 1 volt).

FIG. 8 is an example of a voltage controller according to one embodimentof the present invention. Voltage controller 800 is just one example ofa control circuit that may be used to practice different embodiments ofthe invention. In this example, a battery sense terminal 801 is coupledto a battery to be charged. A second input terminal 802 is coupled tothe output of a digital to analog converter (“VDAC”) for setting thevoltage at the battery terminal to a programmed voltage value. Terminal802 may be coupled through the VDAC to a register or memory that storesa charging parameter to set the voltage at the battery. The batteryvoltage may be adjusted by changing the charging parameter, therebychanging the voltage at terminal 802 across a range of different values.For example, as mentioned above, the output of the voltage controller800, DIFF, will be driven to the same voltage as the error amplifierreference, which is 1 volt in this example. A differential summingnetwork including amplifiers 804 and 805 and the network of resistors806-812 establish the following relation between the voltage at theoutput, DIFF, the battery voltage, BSENSE, and the DAC voltage, VDAC(V):

DIFF=BSENSE−(2.45V+VDAC(V)).

-   Thus, when DIFF is driven to 1 volt by the feedback loop, the    battery voltage is a function of the voltage on the output of the    DAC.

BSENSE=3.45+VDAC(V); when DIFF=1 volt.

-   Accordingly, the battery voltage may be programmed by changing the    digital values of bits coupled to the input of the DAC.

FIG. 9 is an example of a current controller according to one embodimentof the present invention. Current controller 900 is just one example ofa control circuit that may be used to practice different embodiments ofthe invention. In this example, positive and negative current senseterminals 902-903 are coupled across a sense resistor at the input of abattery to be charged. Control input terminal 901 is coupled to acontrol voltage (“Vctrl”) for setting the controlled current into thebattery in response to a digital or analog controller. For example,Vctrl may receive an analog voltage from an analog circuit that isresponsive to either the output voltage or input current for reducingthe battery current as the battery voltage increases. Alternatively,terminal 901 may be coupled through a digital-to-analog converter(“DAC”) to a register or memory that stores a charging parameter to setthe current into the battery. The battery current may be adjusted by adigital controller in response to either the battery voltage or inputcurrent by changing a charging parameter, thereby changing the voltageat terminal 901 across a range of different values. As an example, asmentioned above, the output of the current controller 900, DIFF, will bedriven to the same voltage as the error amplifier reference, which is 1volt in this example. A differential summing network includingamplifiers 905 and 906 and the network of resistors 907-914 establishthe following relation between the voltage at the output, DIFF, thebattery current as measured by voltages, CSENSE+ and CSENSE−, and thecontrol voltage:

DIFF=R2/R1(CSENSE+-CSENSE−)+Vctrl.

-   Thus, when DIFF is driven to 1 volt by the feedback loop, the    battery current is a function of the voltage on Vctrl.

(CSENSE+-CSENSE−)=(1V-Vctrl)/5; when DIFF=1 volt and R2/R1=5.

-   Accordingly, the current supplied to the battery by the switching    regulator may be changed by changing the control voltage (e.g., by    changing the digital values of bits coupled to the input of the    DAC). While the above circuits in FIGS. 7-8 use differential summing    techniques, it is to be understood that other current and/or voltage    summing techniques could be used to sense the output battery current    and voltage and generate control signals to drive the control input    of a switching regulator.

Referring to FIGS. 7-9, one feature of the present invention may includeconnecting the outputs of the current controller and the voltagecontroller to the regulator using a “wired-OR” configuration. Forexample, in one embodiment, the output pull-down transistor of amplifier805 in the voltage controller 800 and the output pull-down transistor ofamplifier 906 in the current controller 900 are “weak” devices. Forexample, the devices for sinking current from the DIFF node are muchsmaller than the devices in amplifiers 805 and 906 for sourcing currentinto the DIFF node. During current control mode, when the batteryvoltage is below the value programmed by VDAC(V), the positive input toamplifier 805 (BSENSE) is below the negative input, and the output ofamplifier 805 will attempt to sink current from DIFF. However, theoutput of current controller amplifier 906 will be driving the DIFF nodein the positive direction. Thus, because the pull-down output ofamplifier 805 is weaker than the pull-up output of amplifier 906, thesystem will be dominated by constant current controller 900. Similarly,when the voltage on the battery (BSENSE) increases to the point wherethe positive and negative inputs of amplifier 805 are equal, the voltagecontroller will dominate. At this point, the current through the senseresistor will begin to decrease, and the output of amplifier 906 willstart to pull down. However, because the pull-down output of amplifier906 is weaker than the pull-up output of amplifier 805, the system willbe dominated by constant voltage controller 800.

FIG. 10 illustrates an example analog controller according to oneembodiment of the present invention. A current controller 1020 includesa first input coupled to “Csense+” and a second input coupled to“Csense−.” Here, Csense+is coupled to the positive terminal of an outputcurrent sense resistor, and Csense− is coupled to the negative terminalof the output current sense resistor. Current controller 1020 willgenerate a control signal to the control input 1004 of switchingregulator 1001. Switching regulator 1001 includes a switching circuit1003, which will, in turn, generate a switching signal (e.g., a pulsewidth modulated signal) to the gate of switching transistor 1002(switching regulator 1001 may also include an error amplifier which hasbeen omitted for illustrative purposes). Current controller 1020 furtherincludes a control input, Vctrl. The voltage at Vctrl may be used tocontrol the battery current. In this example, the voltage at the controlinput to current controller 1020 is set by a current source 1045 into aresistor 1046 (“R1”). When the system is in precharge mode, the currentprovided by current source 1045 may be less than the current providedwhen the system is in fast charge mode. When the system initially entersfast charge mode, the current into resistor 1046 may set a maximumvoltage at Vctrl corresponding to the maximum desired output current.Maximum output current at the beginning of the fast charge cycle may beset by design choice in a variety of ways, including by selection ofresistor 1046. The voltage Vsense is derived from either the switchingregulator input current or battery voltage. Initially, when fast chargemode begins, the voltage Vsense biases transistor 1048 on the edge ofconduction. As the voltage on the battery increases, or as the inputcurrent to the switching regulator increases, Vsense will increase. AsVsense increases, transistor 1048 will turn on and conduct a current(i.e., Vsense/R2), which will steal current away from resistor 1046,thereby causing the voltage at the control input of current controller1020 to decrease. Accordingly, as Vctrl decreases, current controller1020 reduces the output current generated by switching regulator 1001.Therefore, as the battery voltage increases, or as the input currentincreases, Vsense will cause the current controller 1020 to reduce theoutput battery current.

The above description illustrates various embodiments of the presentinvention along with examples of how aspects of the present inventionmay be implemented. The above examples and embodiments should not bedeemed to be the only embodiments, and are presented to illustrate theflexibility and advantages of the present invention as defined by thefollowing claims. Based on the above disclosure and the followingclaims, other arrangements, embodiments, implementations and equivalentswill be evident to those skilled in the art and may be employed withoutdeparting from the spirit and scope of the invention as defined by theclaims. The terms and expressions that have been employed here are usedto describe the various embodiments and examples. These terms andexpressions are not to be construed as excluding equivalents of thefeatures shown and described, or portions thereof, it being recognizedthat various modifications are possible within the scope of the appendedclaims.

1.-73. (canceled)
 74. An integrated circuit comprising: a switchingcircuit to provide a switching signal to a control terminal of aswitching transistor, the switching transistor having a first terminalto receive power from a power source, a second terminal to provide powerto a battery through a filter, and a control terminal; a current controlcircuit to receive an input signal corresponding to a sensed current andto provide a control signal to the switching circuit to control thesensed current, wherein an output current into the battery from thesecond terminal of the switching transistor is greater than an inputcurrent into the first terminal of the switching transistor from thepower source, and wherein the output current is reduced, in a currentcontrol mode, as a voltage on the battery increases.
 75. The integratedcircuit of claim 74 further comprising a voltage control circuit toreceive an input signal corresponding to a sensed voltage on the batteryand to provide a second control signal to the switching circuit tocontrol the sensed voltage.
 76. The integrated circuit of claim 75wherein the integrated circuit is operable in the current control modewhen a voltage on the battery is below a threshold, and wherein theintegrated circuit is operable in a voltage control mode when thevoltage on the battery increases above the threshold.
 77. The integratedcircuit of claim 75 wherein the current control circuit has an outputand the voltage control circuit has an output, and wherein the output ofthe current control circuit is coupled to the output of the voltagecontrol circuit, and wherein the output of the voltage control circuitand the output of the current control circuit are coupled to an input ofthe switching circuit.
 78. The integrated circuit of claim 74 whereinthe switching transistor is an MOS transistor.
 79. The integratedcircuit of claim 74 wherein the sensed current is a current from thepower source to the first input of the switching transistor.
 80. Theintegrated circuit of claim 74 wherein the sensed current is a currentfrom the filter to the battery.
 81. The integrated circuit of claim 74wherein the input signal to the current control circuit is generatedacross a resistor.
 82. The integrated circuit of claim 74 furthercomprising an analog control circuit for generating the input signalcorresponding to the sensed current.
 83. The integrated circuit of claim74 further comprising a digital-to-analog converter for generating theinput signal corresponding to the sensed current.
 84. The integratedcircuit of claim 74 wherein the current control mode is an outputcurrent control mode.
 85. The integrated circuit of claim 74 wherein thecurrent control mode is an input current control mode.
 86. Theintegrated circuit of claim 74 wherein the switching circuit is part ofa switching regulator.
 87. The integrated circuit of claim 74 furthercomprising an input sense circuit to sense the input current to theswitching transistor, the input sense circuit generating the inputsignal corresponding to the sensed current, wherein the sensed currentis a sensed input current.
 88. The integrated circuit of claim 87wherein the sensed input current is compared against a threshold, andwherein the output current changes if the input current is above thethreshold.
 89. The integrated circuit of claim 87 wherein the currentcontrol circuit comprises a first amplifier having an input coupled tothe input signal corresponding to the sensed input current, the firstamplifier having an output coupled to the switching circuit.
 90. Theintegrated circuit of claim 89 wherein the current control circuitcomprises a second amplifier having an input coupled to a second signalcorresponding to a sensed output current, the second amplifier having anoutput coupled to the switching circuit.
 91. The integrated circuit ofclaim 89 wherein the switching circuit comprises an error amplifierhaving an input coupled to the output of the first amplifier.
 92. Theintegrated circuit of claim 87 wherein the current control circuitcomprises a summing network comprising a plurality of amplifiers and aplurality of resistors.
 93. The integrated circuit of claim 92 whereinthe summing network is a differential summing network.
 94. Theintegrated circuit of claim 87 wherein the input sense circuit comprisesa resistor.
 95. The integrated circuit of claim 94 wherein a firstterminal of the resistor receives the input current and a secondterminal of the resistor is coupled to the first terminal of theswitching transistor.
 96. The integrated circuit of claim 87 furthercomprising a voltage control circuit to sense a voltage on the batteryand to provide a second control signal to the switching circuit tocontrol the sensed voltage on the battery, wherein the voltage controlcircuit controls the voltage on the battery when the voltage on thebattery is greater than a threshold and the current control circuitcontrols current when the voltage on the battery is less than thethreshold.
 97. The integrated circuit of claim 74 wherein the currentcontrol circuit includes a first input to receive the input signalcorresponding to a sensed input current, at least one input coupled to afirst terminal of a resistor to sense current into the battery, and anoutput to provide the control signal to the switching circuit.
 98. Theintegrated circuit of claim 97 wherein the current control circuitfurther includes a second input coupled to a second terminal of theresistor, wherein the resistor is configured between the filter and thebattery.
 99. The integrated circuit of claim 74 wherein the inputcurrent is maintained below a predetermined threshold value.
 100. Theintegrated circuit of claim 74 wherein the output current is reducedcontinuously.
 101. The integrated circuit of claim 74 wherein the outputcurrent is reduced incrementally.
 102. The integrated circuit of claim74 wherein the output current is reduced after a precharge mode ofoperation and before a constant voltage charging mode of operation. 103.The integrated circuit of claim 74 the input current is maintainedapproximately constant when the output current is reduced as the outputvoltage on the battery increases.
 104. A method of charging a batterycomprising: receiving power on a first terminal of a switchingtransistor on an integrated circuit from a power source; generating aswitching signal from a switching circuit on the integrated circuit to acontrol terminal of the switching transistor; providing power from asecond terminal of a switching transistor to a battery through a filter;generating, by a current control circuit, a control signal to theswitching circuit based on a first signal corresponding to a sensedcurrent, wherein an output current into the battery from the secondterminal of the switching transistor is greater than an input currentinto the first terminal of the switching transistor from the powersource, and wherein the output current is reduced, in a current controlmode, as a voltage on the battery increases.
 105. The method of claim104 further comprising receiving, by a voltage control circuit, an inputsignal corresponding to a sensed voltage on the battery and providing asecond control signal to the switching circuit to control the sensedvoltage.
 106. The method of claim 105 wherein the integrated circuit isoperable in the current control mode when a voltage on the battery isbelow a threshold, and wherein the integrated circuit is operable in avoltage control mode when the voltage on the battery increases above thethreshold.
 107. The method of claim 105 wherein the current controlcircuit has an output and the voltage control circuit has an output, andwherein the output of the current control circuit is coupled to theoutput of the voltage control circuit, and wherein the output of thevoltage control circuit and the output of the current control circuitare coupled to an input of the switching circuit.
 108. The method ofclaim 104 wherein the switching transistor is an MOS transistor. 109.The method of claim 104 wherein the sensed current is a current from thepower source to the first input of the switching transistor.
 110. Themethod of claim 104 wherein the sensed current is a current from thefilter to the battery.
 111. The method of claim 104 further comprisinggenerating the first signal, wherein generating the first signalcomprises sensing current through a resistor.
 112. The method of claim104 further comprising generating the first signal corresponding to thesensed current using an analog control circuit.
 113. The method of claim104 further comprising generating the first signal corresponding to thesensed current using a digital-to-analog converter.
 114. The method ofclaim 104 wherein the current control mode is an output current controlmode.
 115. The method of claim 104 wherein the current control mode isan input current control mode.
 116. The method of claim 104 wherein theswitching circuit is part of a switching regulator.
 117. The method ofclaim 104 further comprising sensing the input current to the switchingtransistor, and in accordance therewith, generating the first signalcorresponding to the sensed current, wherein the sensed current is asensed input current.
 118. The method of claim 117 wherein the sensedinput current is compared against a threshold, and wherein the outputcurrent changes if the input current is above the threshold.
 119. Themethod of claim 117 wherein the current control circuit comprises afirst amplifier having an input coupled to the first signalcorresponding to the sensed input current, the first amplifier having anoutput coupled to the switching circuit.
 120. The method of claim 119wherein the current control circuit comprises a second amplifier havingan input coupled to a second signal corresponding to a sensed outputcurrent, the second amplifier having an output coupled to the switchingcircuit.
 121. The method of claim 119 wherein the switching circuitcomprises an error amplifier having an input coupled to the output ofthe first amplifier.
 122. The method of claim 117 wherein the currentcontrol circuit comprises a summing network comprising a plurality ofamplifiers and a plurality of resistors.
 123. The method of claim 122wherein the summing network is a differential summing network.
 124. Themethod of claim 117 wherein sensing the input current to the switchingtransistor comprises sensing the input current through a resistor. 125.The method of claim 124 wherein a first terminal of the resistorreceives the input current and a second terminal of the resistor iscoupled to the first terminal of the switching transistor.
 126. Themethod of claim 117 further comprising: sensing a voltage on thebattery; and providing a second control signal to the switching circuitto control the sensed voltage on the battery, wherein the second controlsignal controls the voltage on the battery when the voltage on thebattery is greater than a threshold and the control signal generated bythe current control circuit controls current when the voltage on thebattery is less than the threshold.
 127. The method of claim 104 whereinthe first input current is maintained below a predetermined thresholdvalue.
 128. The method of claim 104 wherein the output current isreduced continuously.
 129. The method of claim 104 wherein the outputcurrent is reduced incrementally.
 130. The method of claim 104 whereinthe output current is reduced after a precharge mode of operation andbefore a constant voltage charging mode of operation.
 131. The method ofclaim 104 the input current is maintained approximately constant whenthe output current is reduced as the output voltage on the batteryincreases.